home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 12
/
Cream of the Crop 12 (Part II)
/
Cream of the Crop 12 (Part II).iso
/
OS2
/
HUGS101O.ZIP
/
Progs
/
HUGS
/
Demos
/
random.hs
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1995-02-14
|
306 b
|
12 lines
-- Generate a list of random numbers of length n
randoms :: Int -> [Int]
randoms = iterate (\seed-> (77*seed+1) `rem` 1024)
rand100 = sort (take 100 (randoms 1000)) -- a sample distribution
adjs [] = [] -- a list of pairs of adjacent
adjs xs = zip xs (tail xs) -- elements in a list